function [shat,qhat,g_level,g1_level,g2_level,g22_level,p_elast,y_elast,sl_level, d_shat_dlog_p,d_shat_dlog_y]=predict_demand(theta,config) 

        %%%%%%%%%%%%%%%%%%%%%%%%%%
        % INITIALIZE
        %%%%%%%%%%%%%%%%%%%%%%%%%%

p_interest=config.p_interest;
y_interest=config.y_interest;
S_interest=config.S_interest;
S_deriv1_interest=config.S_deriv1_interest;
S_deriv2_interest=config.S_deriv2_interest;

        %%%%%%%%%%%%%%%%%%%%%%%%%%
        % PREDICTIONS
        %%%%%%%%%%%%%%%%%%%%%%%%%%

        % LEVEL
        
shat = S_interest*theta;
qhat = log(shat)-p_interest+y_interest;
    
        % SHAT-DERIVATIVES
        
d_shat_dlog_p=S_deriv1_interest*theta;
d_shat_dlog_y=S_deriv2_interest*theta;

        % G_LEVEL
        
g_level=shat.*exp(y_interest)./exp(p_interest);
g1_level=(exp(y_interest)./(exp(p_interest).^2)).*(-shat + d_shat_dlog_p);
g2_level=(1./(exp(p_interest))) .*(d_shat_dlog_y + shat);
g22_level=NaN*g2_level;

        % ELASTICITIES
        
p_elast=g1_level.*exp(p_interest)./g_level;
y_elast=(1./shat).*d_shat_dlog_y + 1;

        % SLUTSKY

sl_level=g1_level + g2_level.* g_level;

    %


